package com.he1618;

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Counter;
import org.springframework.stereotype.Service;

@Service
public class MyCountService {
    private final Counter myCounter;

    public MyCountService(MeterRegistry registry) {
        this.myCounter = Counter.builder("my.custom.counter")
            .register(registry);
    }

    public void incrementCounter() {
        myCounter.increment();
    }
}
